package com.suyafei.consumer;

import com.suyafei.entity.Order;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

/**
 * @program: springboot-rabbitmq
 * @description
 * @author: luffy
 * @create: 2020-11-15 01:28
 */
@Component
public class OrderConsumerListener {
    @Autowired
    private Order order;
    @RabbitListener(queues = "q.pay.waiting")
    public void getTTLMessage(@Payload String orderId) {
        order.removeOrderId(orderId);
    }
}
